<page-header [autoTitle]="false"></page-header>
<nz-card>
  <section class="search-section">
    <input nz-input placeholder="发布人、内容" [(ngModel)]="keyword" class="search-item"/>
    <nz-select [(ngModel)]="status" [nzPlaceHolder]="'是否删除'" class="search-item" [nzAllowClear]="true">
      <nz-option
        *ngFor="let option of yesOrNo"
        [nzLabel]="option.value"
        [nzValue]="option.key">
      </nz-option>
    </nz-select>
    <nz-select [(ngModel)]="beScreen" [nzPlaceHolder]="'是否屏蔽'" class="search-item" [nzAllowClear]="true">
      <nz-option
        *ngFor="let option of yesOrNo"
        [nzLabel]="option.value"
        [nzValue]="option.key">
      </nz-option>
    </nz-select>
    <button nz-button [nzType]="'primary'" nzGhost (click)="search()" class="search-item">
      <i class="anticon anticon-search"></i><span>搜索</span>
    </button>
  </section>
  <nz-table #nzTable [nzData]="page.content"
            [nzPageSize]="page.size"
            [nzTotal]="page.totalElements"
            [nzFrontPagination]="false"
            [(nzPageIndex)]="page.number"
            (nzPageIndexChange)="changePageNo($event)"
            [nzLoading]="isLoading">
    <thead>
    <tr>
      <th nz-th><span>序号</span></th>
      <th nz-th><span>发布人</span></th>
      <th nz-th><span>内容</span></th>
      <th nz-th><span>是否删除</span></th>
      <th nz-th><span>是否屏蔽</span></th>
      <th nz-th><span>发布时间</span></th>
      <th nz-th><span>操作</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data;let i=index">
      <td>
        {{i+1}}
      </td>
      <td>{{data.cusName}}</td>
      <td [title]="data.content">{{data.content|stringEllipsisCutPipe:36}}</td>
      <td>{{data.status|yesNoPipe}}</td>
      <td>{{data.beScreen|yesNoPipe}}</td>
      <td>{{data.saveDate}}</td>
      <td>
        <a href="javascript:void (0);" (click)="seeDetail(data)">查看详情</a>
        <nz-divider nzType="vertical"></nz-divider>
        <nz-popconfirm [nzTitle]="'确定屏蔽这条动态吗？'" (nzOnConfirm)="toBeScreen(data,1)">
          <a nz-popconfirm *ngIf="data.beScreen == 2">屏蔽</a>
        </nz-popconfirm>
        <nz-popconfirm [nzTitle]="'确定取消屏蔽这条动态吗？'" (nzOnConfirm)="toBeScreen(data,2)">
          <a nz-popconfirm *ngIf="data.beScreen == 1">取消屏蔽</a>
        </nz-popconfirm>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>

